FILE(GLOB worker_INCLUDES ${CMAKE_CURRENT_SOURCE_DIR}/src/*.h)
FILE(GLOB worker_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/src/*.cpp)

QT5_WRAP_CPP(worker_MOC_out ${worker_INCLUDES})

IF(ITALC_BUILD_WIN32)
	SET(WINRC "${CMAKE_CURRENT_BINARY_DIR}/italc-worker-rc.obj")
	ADD_CUSTOM_COMMAND(OUTPUT ${WINRC}
						COMMAND ${WINDRES}
							-I${CMAKE_CURRENT_SOURCE_DIR}
							-o${WINRC}
							-i${CMAKE_CURRENT_BINARY_DIR}/italc-worker.rc
						DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/italc-worker.rc)
ENDIF(ITALC_BUILD_WIN32)

INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/src)
ADD_EXECUTABLE(italc-worker ${worker_UIC_out} ${worker_SOURCES} ${worker_INCLUDES} ${worker_MOC_out} ${WINRC})
TARGET_LINK_LIBRARIES(italc-worker italc-core Qt5::Network)

INSTALL(TARGETS italc-worker RUNTIME DESTINATION bin)

IF(ITALC_BUILD_WIN32)
	SET_TARGET_PROPERTIES(italc-worker PROPERTIES LINK_FLAGS -mwindows)
ENDIF(ITALC_BUILD_WIN32)

